<template>
  <el-form-item :class="getClz(['autoheight'])" :label="opt.text" :prop="opt.name"  v-bind="opt.itemProps">
    <el-input v-model="data[opt.name]" :placeholder="opt.props.disabled?'':opt.placeholder"
              style="min-height: 32.5px;"
      type="textarea"
      v-bind="opt.props"
      :show-word-limit="Boolean(opt.props.maxlength)"
      @blur="onBlur(data,column)"
      @change="onChange(data,column)"/>
  </el-form-item>
</template>

<script>
  import extend from '../extend';
  let Log = ()=>{};

  export default {
    name: "FormTextarea",
    mixins:[extend],
    data(){
      return {
        opt:{
          name:'',
          text:'',
          itemProps:{},
          props:{
            disabled:false,
            rows:2
          },
          placeholder:'',
        }
      }
    },
    created(){
      this.initOptions();
      this.onChange = this.column.onChange||Log;
      this.onBlur = this.column.onBlur||Log;
    },
    methods:{
      setValue(val){
        this.data[this.opt.name] = val;
      }
    }
  }
</script>
